package com.huawang.ecolink.apps.controllers.modelica;

import com.huawang.ecolink.apps.response.BaseResponse;
import com.huawang.ecolink.apps.response.modelica.ImportLibraryVO;
import com.huawang.ecolink.apps.service.modelica.LibraryService;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;

@Api(tags = "标准库接口")
@RestController
@RequestMapping("/mlink")
@Slf4j
public class StandardLibraryController {

    @Autowired
    private LibraryService libraryService;

    /***
     * @Description: 标注库导入模型接口
     * @param importLibraryVO ImportLibraryVO
     * @return: com.huawang.ecolink.apps.response.BaseResponse<java.lang.String>
     * @throws:
     */
    @ApiOperation("标准库导入")
    @PostMapping("/modelica/library/import")
    @ApiResponses({@ApiResponse(code = 1000, message = "OK", response = String.class)})
    public BaseResponse<String> importLibrary(@RequestBody ImportLibraryVO importLibraryVO) throws IOException {
        libraryService.importLibrary(importLibraryVO);
        return BaseResponse.success();
    }

}
